package com.esun.rabbit2.viewer.mainact.lotteryhallact;

import com.esun.config.Config;
import com.esun.util.log.EDebug;

import android.app.Activity;
import android.os.Handler;
import android.view.View;

public abstract class SportteryBuyLottery extends Activity{

	public static final String INFO = "info"; 
	public static final String IS_CHECKED = "is_checked";
	public static final String W = "w";
	public static final String D = "d";
	public static final String L = "l";
	public static final String IS_ACTIVE = "is_active";
	public static final String IS_DAN = "is_dan";
	public static final String TAG = "tag";
	public static final String TEAM_COUNT = "team_count";
	public static final String TYPE = "type";
	public static final String STR_TYPE = "str_type";
	
	public static final int LIMIT_DAN_COUNT = 7;
	
	public static final int BUY_SUCCEED = 11001;
	public static final int BUY_FAIL = 11002;
	
	public  static final int TEXT_CHECKED_COLOR = 0xffff6000;
	public  static final int TEXT_UNCHECKED_COLOR = 0xff675532;
	
	
	
	protected Handler handlerChooseList;// 界面的handler
	
	
	protected int limitDanNum; //胆码个数限制
	
	/** 获取胆码个数上限 */
	public int getLimitDanNum() {
		return limitDanNum;
	}

	/** 设置胆码个数上限 */
	public void setLimitDanNum(int limitDanNum) {
		this.limitDanNum = limitDanNum;
	}
	
	protected void setHandler(Handler handler){
		handlerChooseList = handler;
	}
	
	public abstract View getView();
	public abstract void setSportteryChooseListPage(SportteryChooseList chooseListPage);

	protected String strLengthOption(String str, int max) {
		EDebug.o(this, str + "==>" + str.length() + "==>" + max);
		String str_ = str.replaceAll("\\s", Config.NULLMARK);
		if (str_.length() < max + 1) {
			return str;
		} else {
			StringBuffer sb = new StringBuffer();
			sb.append(str.substring(0, max - 1)).append(Config.ELLIPSIS);
			String result = sb.toString();
			return result;
		}
	}
}
